#!/bin/bash
#==============================================================#
# File      :   uninstall
# Ctime     :   2021-06-29
# Mtime     :   2021-06-29
# Desc      :   Uninstall pgsql monitoring system
# Path      :   app/pgsql/uninstall
# Copyright (C) 2018-2021 Ruohang Feng
#==============================================================#

# detect environment
PROG_NAME="$(basename $0))"
PROG_DIR="$(cd $(dirname $0) && pwd)"

# fetch parameter
PGURL=${1-'postgres://dbuser_dba:DBUser.DBA@:5432/meta'}
GFDIR=${2-'/etc/dashboards'}

# remove dashboards definition
cp -rf ${PROG_DIR}/dashboards/* ${GFDIR}/
rm -rf ${GFDIR}/pgsql

# rm -rf /etc/dashboards/pgsql
exit 0